package com.tuyan.aixiang.component;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.widget.TextView;

import com.tuyan.aixiang.R;
import com.tuyan.aixiang.common.lang.VoidFunction;

import androidx.annotation.NonNull;

public class ConfirmDialog extends Dialog {

    private VoidFunction onConfirm;

    private VoidFunction onReject;

    private TextView tvTitle;

    private TextView tvContent;

    public ConfirmDialog(@NonNull Context context) {
        super(context, R.style.OpDialog);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.confirm_dialog);

    }

    public void show(String title, String coentnt, VoidFunction onConfirm, VoidFunction onReject) {
        super.show();

        setOnConfirm(onConfirm);
        setOnReject(onReject);
    }

    public void setOnConfirm(VoidFunction func) {
        onConfirm = func;
    }

    public void setOnReject(VoidFunction func) {
        onReject = func;
    }
}
